<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout">
<head th:replace="dashboard/header :: header"></head>
<body>

<!--
@desc  添加
@author WeiXiaoJin
@since 2020-01-30 07:28:26
-->
	<div layout:fragment="content">
		<div class="container-fluid content-main">
			<div class="animated fadeIn">
				<div class="row">
					<!-- /.col-->
					<div class="col-sm-12">
						<div class="card">
							<div class="card-body">
								<form class="form-horizontal" id="addForm">
<div class="form-group row">
	<label class="col-md-2 col-form-label control-label" for="text-input">插件id</label>
	<div class="col-md-9">
				<input class="form-control" id="pluginId" type="text" name="pluginId" placeholder="插件id">
			</div>
</div>
												<div class="form-group row">
	<label class="col-md-2 col-form-label control-label" for="text-input">选择器名称</label>
	<div class="col-md-9">
				<input class="form-control" id="name" type="text" name="name" placeholder="选择器名称">
			</div>
</div>
												<div class="form-group row">
	<label class="col-md-2 col-form-label control-label" for="text-input">匹配方式（0 and  1 or)</label>
	<div class="col-md-9">
				<input class="form-control" id="matchMode" type="text" name="matchMode" placeholder="匹配方式（0 and  1 or)">
			</div>
</div>
												<div class="form-group row">
	<label class="col-md-2 col-form-label control-label" for="text-input">类型（0，全流量，1自定义流量）</label>
	<div class="col-md-9">
				<input class="form-control" id="type" type="text" name="type" placeholder="类型（0，全流量，1自定义流量）">
			</div>
</div>
												<div class="form-group row">
	<label class="col-md-2 col-form-label control-label" for="text-input">排序</label>
	<div class="col-md-9">
				<input class="form-control" id="sort" type="text" name="sort" placeholder="排序">
			</div>
</div>
												<div class="form-group row">
	<label class="col-md-2 col-form-label control-label" for="text-input">处理逻辑（此处针对不同的插件，会有不同的字段来标识不同的处理，所有存储json格式数据）</label>
	<div class="col-md-9">
				<input class="form-control" id="handle" type="text" name="handle" placeholder="处理逻辑（此处针对不同的插件，会有不同的字段来标识不同的处理，所有存储json格式数据）">
			</div>
</div>
												<div class="form-group row">
	<label class="col-md-2 col-form-label control-label" for="text-input">是否开启</label>
	<div class="col-md-9">
				<input class="form-control" id="enabled" type="text" name="enabled" placeholder="是否开启">
			</div>
</div>
												<div class="form-group row">
	<label class="col-md-2 col-form-label control-label" for="text-input">是否打印日志</label>
	<div class="col-md-9">
				<input class="form-control" id="loged" type="text" name="loged" placeholder="是否打印日志">
			</div>
</div>
												<div class="form-group row">
	<label class="col-md-2 col-form-label control-label" for="text-input">是否继续执行</label>
	<div class="col-md-9">
				<input class="form-control" id="continued" type="text" name="continued" placeholder="是否继续执行">
			</div>
</div>
												<div class="form-group row">
	<label class="col-md-2 col-form-label control-label" for="text-input">创建时间</label>
	<div class="col-md-9">
				<div class="input-group date">
			<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
			<input type="text" class="form-control time-input" 
			       id="dateCreated-3" 
			       name="dateCreated" 
			       data-type="datetime" 
			       data-format="yyyy-MM-dd HH:mm:ss" 
			       placeholder="yyyy-MM-dd HH:mm:ss" lay-key="dateCreated-3">
		</div>
			</div>
</div>
												<div class="form-group row">
	<label class="col-md-2 col-form-label control-label" for="text-input">更新时间</label>
	<div class="col-md-9">
				<div class="input-group date">
			<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
			<input type="text" class="form-control time-input" 
			       id="dateUpdated-3" 
			       name="dateUpdated" 
			       data-type="datetime" 
			       data-format="yyyy-MM-dd HH:mm:ss" 
			       placeholder="yyyy-MM-dd HH:mm:ss" lay-key="dateUpdated-3">
		</div>
			</div>
</div>
																			</form>
							</div>
						</div>
					</div>
					<!-- /.col-->
				</div>
			</div>
		</div>

	</div>

	<footer th:replace="dashboard/footer :: footer"></footer>

	<script type="text/javascript">
		var addForm = $("#addForm") ; 
		$(function(){
			addForm.validate({
				ignore: [],  
				rules: {
pluginId: {required:true}
,name: {required:true}
,matchMode: {required:true,number:true}
,type: {required:true,number:true}
,sort: {required:true,number:true}
,handle: {required:true}
,enabled: {required:true}
,loged: {required:true}
,continued: {required:true}
,dateCreated: {required:true,date:true}
,dateUpdated: {required:true,date:true}
				}
			});
		}) ;

		function submitHandler() {
			var result = $.validate.form("addForm");
			if(result){	
				var saveUrl = ctx+"gateway/admin/gateSelector/save" ;
				$.operate.save(saveUrl , addForm.serialize());
			}
	    }
	</script>

</body>
</html>


